<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input id="c-id" data-rule="required" class="form-control" size="50" readonly name="row[id]" type="hidden" value="{$row.id}">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*商家封面图:</label>
        <div class="col-xs-12 col-sm-6">
            <div class="input-group">
                <input id="c-logo" data-rule="required" readonly class="form-control" size="50" name="row[logo]" type="text" value="{$row.logo??''}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-logo" class="btn btn-danger plupload" data-url="shop/upload"  data-input-id="c-logo" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-logo"><i class="fa fa-upload"></i> 上传</button></span>
                </div>
                <span class="msg-box n-right" for="c-logo"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-logo"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*商家图片:</label>
        <div class="col-xs-12 col-sm-6">
            <div class="input-group">
                <input id="c-images" data-rule="required" class="form-control" size="50" readonly name="row[images]" type="text" value="{$row.images??''}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-maxcount="5" data-url="shop/upload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> 上传</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*营业执照:</label>
        <div class="col-xs-12 col-sm-6">
            <div class="input-group">
                <input id="c-business_license" data-rule="required" readonly class="form-control" size="50" name="row[business_license]" type="text" value="{$row.business_license??''}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-url="shop/upload" data-input-id="c-business_license" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-business_license"><i class="fa fa-upload"></i> 上传</button></span>
                </div>
                <span class="msg-box n-right" for="c-business_license"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-business_license"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*商家名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-shop_name" data-rule="required" class="form-control" name="row[shop_name]" type="text" value="{$row.shop_name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*联系电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" class="form-control" data-rule="required" name="row[phone]" type="text" value="{$row.phone|htmlentities}">
            <p class="help-block"><i style="color: red">多个电话请用,隔开,(例如 18850455****,17765656**,0592-285***)</i></p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">微信号:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-wechat" class="form-control" name="row[wechat]" type="text" value="{$row.wechat|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*地区:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="province,city,areas">
                <select class="province form-control" name="row[province]" data-url="ajax/area" data-value="{$row.province ?? ''}"></select>
                <select class="city form-control" name="row[city]" data-query-name="province" data-url="ajax/area" data-value="{$row.city ?? ''}"></select>
                <select class="areas form-control" name="row[districts]" data-query-name="city" data-url="ajax/area" data-value="{$row.districts ?? ''}"></select>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*详细地址:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" class="form-control" data-rule="required" name="row[address]" type="text" value="{$row.address|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*经纬度:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-coordinate" class="form-control" data-rule="required" name="row[coordinate]" type="text" value="{$row.coordinate|htmlentities}">
            <p class="help-block"><a target="_blank" href="https://lbs.qq.com/getPoint">腾讯地图坐标拾取</a></p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*联系人:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contacts" data-rule="required" class="form-control" name="row[contacts]" type="text" value="{$row.contacts|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*法人:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-legal_person" data-rule="required" class="form-control" name="row[legal_person]" type="text" value="{$row.legal_person|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*固定充值金额:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-fixed_amount" data-rule="required" class="form-control" step="0.01" name="row[fixed_amount]" type="number" value="{$row.fixed_amount|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*来源:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[source]', $sourceMap, $row['source'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">可发布的商机:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_checkboxs('row[service][]', $serviceIds,$row['service'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">注意事项:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control editor" id="attention" name="row[attention]" cols="60" rows="30">{$row.attention|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">门店简介:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control editor" id="detail" name="row[detail]" cols="60" rows="30">{$row.detail|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">*状态:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', $statusMap, $row['status'])}
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script src="https://xm.xmlhzx.cn/assets/js/jquery-2.1.1.min.js"></script>
<script>
    $(document).ready(function(){
        // +号图片点击事件
        $(document.body).on("click", "#uploadimg", function () {
            $("#plupload-images").trigger('click');
        });
    });
</script>

